package hottargui.config;

import java.util.List;

import hottargui.framework.GameData;
import hottargui.framework.PlayerColor;
import hottargui.framework.Tile;
import hottargui.standard.StandardBoardStrategy;

public class AlphaTestBoardStrategy extends StandardBoardStrategy {
	
	private Tile getTile(GameData gameData, int row, int col)
	{
		List<Tile> boardConf = gameData.getBoardConfiguration();
		
		return boardConf.get((row * 7) + col);	
	}
	
	@Override
	public void setupBoard(GameData gameData)
	{
		super.setupBoard(gameData);
		
		// TODO: setup appropriate tile configuration
	
		// corner tiles
		Tile ul = getTile(gameData, 0, 0);
		ul.setOwnerColor(PlayerColor.Red);
		ul.setUnitCount(10);
		
		Tile ur = getTile(gameData, 0, 6);
		ur.setOwnerColor(PlayerColor.Green);
		ur.setUnitCount(10);
		
		Tile ll = getTile(gameData, 6, 0);
		ll.setOwnerColor(PlayerColor.Blue);
		ll.setUnitCount(10);
		
		Tile lr = getTile(gameData, 6, 6);
		lr.setOwnerColor(PlayerColor.Yellow);
		lr.setUnitCount(10);
		
		// Red tile immediately under red settlement has 7 units
		Tile redTile = getTile(gameData, 1, 0);
		redTile.setOwnerColor(PlayerColor.Red);
		redTile.setUnitCount(7);
		
		// Red tile on (2,3) for adjacency testing
		Tile adjTile = getTile(gameData, 2, 3);
		adjTile.setOwnerColor(PlayerColor.Red);
		adjTile.setUnitCount(10);
		
		// Red tile on (3,1) for saltlake testing
		Tile saltLake = getTile(gameData, 3, 1);
		saltLake.setOwnerColor(PlayerColor.Red);
		saltLake.setUnitCount(10);
		
		// Red tile for attacking
		Tile redAttack = getTile(gameData, 1, 4);
		redAttack.setOwnerColor(PlayerColor.Red);
		redAttack.setUnitCount(10);
		
		// Green tile for losing battle
		Tile greenLose = getTile(gameData, 2, 5);
		greenLose.setOwnerColor(PlayerColor.Green);
		greenLose.setUnitCount(5);
		
		// Green tile for tied battle
		Tile greenTie = getTile(gameData, 1, 5);
		greenTie.setOwnerColor(PlayerColor.Green);
		greenTie.setUnitCount(10);
		
		// Green tile for successful defense
		Tile greenWin = getTile(gameData, 0, 5);
		greenWin.setOwnerColor(PlayerColor.Green);
		greenWin.setUnitCount(13);
		
		// Extra tiles for revenue
		Tile yellowRev = getTile(gameData, 5, 6);
		yellowRev.setOwnerColor(PlayerColor.Yellow);
		
		Tile blueRev = getTile(gameData, 5, 0);
		blueRev.setOwnerColor(PlayerColor.Blue);
		
		blueRev = getTile(gameData, 4, 1);
		blueRev.setOwnerColor(PlayerColor.Blue);
	}
}
